package com.learn.training.multithread.chapter3;

public class ThreadMain {
    public static void main(String[] args) throws InterruptedException {
            Thread t = new Thread(() -> {
                System.out.println("hello");
                try {
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("world");
            });
            System.out.println("start");
            t.start(); // 启动t线程
            t.join(); // 此处main线程会等待t结束
            System.out.println("end");

    }
}